package com.njtoyo.taxi.admin.mapper.master.mapper;

import cn.hutool.core.date.DateTime;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njtoyo.taxi.admin.library.Const;
import com.njtoyo.taxi.admin.mapper.master.entity.DriverServiceLog;
import com.njtoyo.taxi.admin.rest.presenter.business.driver.DriverServiceLogPresenter;
import com.njtoyo.taxi.admin.rest.wrapper.business.driver.DriverServiceLogQueryWrapper;
import com.njtoyo.taxi.admin.rest.wrapper.business.driver.DriverServiceLogExportWrapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 司机出车时长记录表 Mapper 接口
 * </p>
 *
 * @author Dell
 * @since 2021-08-01
 */
@Repository
@DS(Const.PRIMARY_DS)
public interface DriverServiceLogMapper extends BaseMapper<DriverServiceLog> {
    Map getWorkingCount(@Param("cantonIds") List<Long> cantonIds, @Param("companyIds") List<Long> companyIds, @Param("startDate") DateTime startDate, @Param("endDate") DateTime endDate);

    List<Map> getWorkingTaxiGroupByDate(@Param("cantonIds") List<Long> cantonIds, @Param("companyIds") List<Long> companyIds, @Param("startDate") DateTime startDate, @Param("endDate") DateTime endDate, @Param("groupType") String groupType);

    //出车司机名单
    Page<DriverServiceLogPresenter> dailyWorkingDriver(DriverServiceLogQueryWrapper wrapper);

    List<DriverServiceLogPresenter> dailyWorkingDriverExport(DriverServiceLogExportWrapper wrapper);


    List<DriverServiceLog> selectListByTaskTimeGroupByDriverId(@Param("driverIds") List<Long> driverIds, @Param("taskTime") Date taskTime);
}
